<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
String rightPage = (String)request.getAttribute("rightPage");
%>
<!DOCTYPE HTML ">
<html>
<head>
<c:set var="title" value="个人中心" scope="request" />

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<link href="/shop/css/shop-top.css" rel="stylesheet" />
<link href="/shop/css/shop-detail.css" rel="stylesheet" />
<link href="/shop/css/shop-footer.css" rel="stylesheet" />
<link href="/shop/css/shop-tuan.css" rel="stylesheet" />
<link href="/shop/css/shop-common.css" rel="stylesheet" />

<jsp:include page="/head.jsp" />
<script type="text/javascript" src="/shop/js/shop-/public.js"></script>
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="/shop/js/shop-layer.js"></script>
</head>

<body>
    <c:import url="/news-class.do?mb=header" /> 
	<%@ include file="jsps/top.jsp"%>
	<div class="yershop_wrapper">
		<%@ include file="jsps/hader.jsp"%>
		<div class="menu-wrapper">
			<div class="nava">
				
				<ul class="menu" style="margin-left: 46px;">
					<li><a href="shop.html" target="_self">首页</a></li>
				</ul>
			</div>
		</div>
		<!-- /菜单 -->

		<!-- 主体 -->
		<div class="commom_wrapper">

			<div class="main">
				<div class="main_center">
					<div class="center_left">
						<!-- 左侧菜单 -->
						<h3 style="margin-left: 0px;">
							<a rel="nofollow" href="javascript:vod(0)" class="home-me" >我的会员中心</a>
						</h3>
						<dl>
							<dd>
								<a rel="nofollow" href="sss-1.do" class="current"
									<c:if test="${rightPage=='orderAll' || rightPage=='orderDetail' }">class="current"</c:if>>我的订单</a>
							</dd>
						</dl>

						<dl class="last">
							<dd>
								<a rel="nofollow" href="userAddress.page"
									<c:if test="${rightPage=='address' || rightPage=='addAddress' }">class="current"</c:if>>地址管理</a>
								<!-- <a rel="nofollow" href="userAddress.page" class="current">地址管理</a> -->
							</dd>

							<dd>
								<a rel="nofollow" href="index.cart">我的购物车</a>
							</dd>

						</dl>
						<script>
							/* 左边菜单高亮 */
							url = window.location.pathname
									+ window.location.search;
							url = url
									.replace(
											/(\/(p)\/\d+)|(&p=\d+)|(\/(id)\/\d+)|(&id=\d+)|(\/(group)\/\d+)|(&group=\d+)/,
											"");

							$("a[href='" + url + "']").addClass("current");
						</script>

						<!-- 左侧菜单 -->

					</div>
					<!-- 个人中心 初始状态 start -->
					<%@ include file="orderAll.jsp"%>
				</div>
			</div>
			<!-- 主体 -->

			<!-- 购物车js -->
			<script>
				//购物车显示与隐藏
				var Shopcart = document.getElementById('shopping_cart');
				var Goodsmenu = document.getElementById('goods');
				var timerr = null;//定义定时器变量
				//鼠标移入div1或div2都把定时器关闭了，不让他消失
				Shopcart.onmouseover = Goodsmenu.onmouseover = function() {
					Goodsmenu.style.display = 'block';
					clearTimeout(timerr);
				}
				//鼠标移出div1或div2都重新开定时器，让他延时消失
				Shopcart.onmouseout = Goodsmenu.onmouseout = function() {
					//开定时器
					timerr = setTimeout(function() {
						Goodsmenu.style.display = 'none';
					}, 10);
				}

				//购物车动态删除
				function delcommon(event) { //获取事件源
					event = event ? event : window.event;
					var obj = event.srcElement ? event.srcElement
							: event.target;
					//这时obj就是触发事件的对象，可以使用它的各个属性 
					//还可以将obj转换成jquery对象，方便选用其他元素 
					str = obj.innerHTML.replace(/<\/?[^>]*>/g, ''); //去除HTML tag

					var $obj = $(obj);
					var str = $obj.parent().prev().html();
					if (obj.rel == "del") {
						var str = obj.name;
						var uexist = "";
						//全选的实现 定义删的发送路径
						if (uexist) {
							var del = '/index.php?s=/Home/Shopcart/delItemByuid.html';
						} else {
							var del = 'delShoppingCart.goods';

						}

						$
								.ajax({
									type : 'post', //传送的方式,get/post
									url : del, //发送数据的地址
									data : {
										sort : str
									},
									dataType : "json",
									success : function(data) {
										var $obj = $(obj);
										$obj.parents("li").remove();
										if (data.sum == "0") { //判断购物车数量是否为0，为0则隐藏底部查看工具
											$("div.sc_goods_foot").hide();
											var html = '<p class="sc_goods_none" >您的购物车还是空的，赶紧行动吧！</p>';
											$("ul.sc_goods_ul").html(html);

										} else {
											$("div.sc_goods_foot").show();
										}

									},
									error : function(event, XMLHttpRequest,
											ajaxOptions, thrownError) {
										alert(XMLHttpRequest + thrownError);
									}
								})
					}

				}
				//购物车删除结束
			</script>
			<!-- /购物车js -->

			<!-- 底部-->
			<script type="text/javascript" charset="utf-8"
				src="/shop/js/shop-menudown.js"></script>

		</div>
	</div>
	<%@ include file="jsps/footer.jsp"%>
</body>
</html>
